<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script src="../js/pixi.min.js"></script>
		<script type="text/javascript">
			var app=new PIXI.Application(800,600);
			document.body.appendChild(app.view);
			
			function add(src,x,y,shi){
				var yuans=new PIXI.Sprite.fromImage(src);
				yuans.x=x;
				yuans.y=y;
				app.stage.addChild(yuans);
				yuans.buttonMode=true;
				yuans.interactive=true;
				// yuans.anchor.set(0.5,0.5);
				return yuans;
			}
			var bj= add("img/img/bg1.jpg",0,0);
			var zx= add("img/img/zhunxing.png",400,300);
			var xy=new PIXI.Text("哎哎哎");
			xy.x=10;
			xy.y=500;
			xy.style.fill="#bec3cf";
			app.stage.addChild(xy);
			zx.anchor.set(0.5,0.5);
			
			
			
			function mousemove1(event){
				var pow= event.data.getLocalPosition(app.stage);
				zx.x=pow.x;
				zx.y=pow.y;
				xy.text="X:"+pow.x+"Y:"+pow.y;
				
				
			}
			function dahen(event){
				var pow= event.data.getLocalPosition(app.stage);
				var dan=new PIXI.Sprite.fromImage("img/img/danhen.png");
				dan.anchor.set(0.5,0.5);
				dan.x=pow.x;
				dan.y=pow.y;
				app.stage.addChild(dan);
			}
			zx.on("mousemove",mousemove1);
			zx.on("mousedown",dahen);
		</script>
	</body>
</html>